import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [

  {
    path: '/',
    name: 'layout',
    redirect: '/banner',
    component:  () => import('@/Layout/index.vue'),
    children: [
        {
            name: 'Banner',
            path: '/banner',
            component:  () => import('@/views/Banner/index.vue'),
        },
        {
            name: 'bannerSave',
            path: '/banner/Save/:id?',
            component:  () => import('@/views/Banner/Save.vue'),
        },
        {
            name: 'LawyerPractice',
            path: '/LawyerPractice',
            component:  () => import('@/views/LawyerPractice/index.vue'),
        },
        {
            name: 'LawyerPracticeSave',
            path: '/LawyerPractice/Save/:id?',
            component:  () => import('@/views/LawyerPractice/Save.vue'),
        },
        {
            name: 'LawyerFun',
            path: '/LawyerFun',
            component:  () => import('@/views/LawyerFun/index.vue'),
        },
        {
            name: 'LawyerFunSave',
            path: '/LawyerFun/Save/:id?',
            component:  () => import('@/views/LawyerFun/Save.vue'),
        },
        {
            name: 'Lawyer',
            path: '/Lawyer',
            component:  () => import('@/views/Lawyer/index.vue'),
        },
        {
            name: 'LawyerSave',
            path: '/Lawyer/Save/:id?',
            component:  () => import('@/views/Lawyer/Save.vue'),
        },
        {
            name: 'LegalHubDetail',
            path: '/LegalHubDetail',
            component:  () => import('@/views/LegalHubDetail/index.vue'),
        },
        {
            name: 'legalHubDetailSave',
            path: '/legalHubDetail/Save/:id?',
            component:  () => import('@/views/LegalHubDetail/Save.vue'),
        },
        {
            name: 'legalHubDetailDetail',
            path: '/legalHub/Detail/:id?',
            component:  () => import('@/views/LegalHubDetail/detail.vue'),
        },
        {
            name: 'role',
            path: '/role',
            component:  () => import('@/views/role/index.vue'),
        },
        {
            name: 'roleSave',
            path: '/role/Save/:id?',
            component:  () => import('@/views/role/Save.vue'),
        },
        {
            name: 'user',
            path: '/user',
            component:  () => import('@/views/user/index.vue'),
        },
        {
            name: 'userSave',
            path: '/user/Save/:id?',
            component:  () => import('@/views/user/Save.vue'),
        },
        {
            name: 'cardList',
            path: '/cardList',
            component:  () => import('@/views/user/cardList.vue'),
        },
    ]
  },
    {
        path: '/login',
        name: 'login',
        component: () =>  import('@/views/Login/loginForm.vue')
    },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
